<template>
    <div class="list">
        
        <p v-for="(v,index) in arr" :key="index" @click="send(v.sid)" >{{v.text}}</p>
        <hello-world @meg="meg"></hello-world>
        
    </div>
</template>
<script>
import HelloWorld from './HelloWorld.vue';

export default {
    name: 'list01',
     components: {  
      HelloWorld
       },
    
    data(){
        return{
            arr:[],
            
        }
    },
    methods:{
        meg(a){
            console.log(a);
            this.axios.get("https://api.apiopen.top/getJoke?count=5&page="+a).then((result)=>{
				console.log(result);
                this.arr = result.data.result;
			})
        },
        send(s){
            this.$router.push({         //2、进行传参
		                    path: "/dell",
		                    query: {
		                        sid: s
		                    }
		                }).catch((e) => { })
                        
		            }
        },
    
    mounted(){
        //  this.axios.get("https://api.apiopen.top/getWangYiNews?page=5&count=2").then(result=>{
		// 		console.log(result);
		// 	})
        this.meg(1);
    }
}
</script>
<style scoped>
.list{
    margin-top: 40px;
}
</style>